
<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../order/left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>:  <@s.m "order.function"/> - 发货</div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt">
                            <input type="button" value="返回" onclick="history.back();"/>
                        </form>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <@p.form id="baseForm" action="o_shipments.do" labelWidth="12">
                        <@p.td colspan="2"><strong class="title">发货信息</strong></@p.td><@p.tr/>
                    <@p.td colspan="1" width="50" label="订单编号">${order.code}</@p.td>
                <@p.td colspan="1" width="50" label="order.paymentStatus">
                <@s.m "order.paymentStatus.${order.paymentStatus}"/>
            </@p.td>
            <@p.tr/>
            <@p.td colspan="1" width="50" label="收货人姓名">${order.receiveName!}</@p.td>
                        <@p.td colspan="1" width="50" label="收货人电话">${order.receiveMobile!}</@p.td><@p.tr/>
                    <@p.td colspan="1" width="50" label="收货人固定电话">${order.receivePhone!}</@p.td>
                <@p.td colspan="1" width="50" label="收货人邮编">${order.receiveZip!}</@p.td><@p.tr/>
                <@p.td colspan="2" label="收货人地址">${order.receiveAddress!}</@p.td><@p.tr/>


                <@p.td label="货运单号" colspan="1" width="50">${shipments.waybill!}</@p.td>
                <@p.td label="金额 " colspan="1" width="50">${shipments.money!}</@p.td><@p.tr/>
                <@p.td label="操作员" colspan="2" width="50">${shipments.shopAdmin.username!}</@p.td><@p.tr/>
                <@p.td colspan="2" label="备注">${shipments.comment}</@p.td><@p.tr/>
                </@p.form>
            </div>
    </div>



    </div>

    </div>
</body>
</html>



<script type="text/javascript">
    function changeCount(){
        var totalWeight=0.0;
        $("#[id^='itemCount_']").each(function(){
            var ss=parseFloat(jQuery(this).val());
            var h=jQuery(this).attr("id");
            var index=h.split("_")[1];
            var weight=$("#itemWeight_"+index).html();
            totalWeight+=ss*weight;
        });
        ajaxtotalDeliveryFee($("#shippingId").val(),totalWeight);
        setTimeout(function(){changePrice()},1000);
    }

    function changePrice(){
        var totalPrice=0.0;
        $("#[id^='itemPrice_']").each(function(){
            var ss=parseFloat(jQuery(this).val());
            var h=jQuery(this).attr("id");
            var index=h.split("_")[1];
            var count=$("#itemCount_"+index).val();
            $("#subtotal_"+index).html("");
            $("#subtotal_"+index).html(count*ss);
            totalPrice+=count*ss;
        });
        $("#productPrice").html("");
        $("#productPrice").html(totalPrice);
        $("#total").html("");
        $("#total").html(parseFloat($("#freight").val())+totalPrice);
        $("#totalPice").val(parseFloat($("#freight").val())+totalPrice);
    }

    function changeFreight(){
        var ss=parseFloat($("#productPrice").html());
        $("#total").html("");
        ss+=parseFloat($("#freight").val());
        $("#total").html(ss);
    }

    function ajaxtotalDeliveryFee(d,w){
        $.post("../order/ajaxtotalDeliveryFee.do", {
            'deliveryMethod':d,
            'weight':w
        }, function(data) {
            if(data.status==1){
                $("#freight").val(data.freight);
                return data.freight;
            }
        },'json');
    }

    function statusChange(status){
        if(status==19){
            $("#baseForm").attr("action","o_returnMoney.do");
        }
        $("#status").val(status);
    }
</script>